/**
 * Created by z30 on 16/1/18.
 */


var mysql            = require('mysql');
var ev               = require('./envv.js');


//var nhost='';
//var npwd='';
//var nport=0;
//if(envjson.device==="test.txt")
//{
//    nhost='172.16.31.52';
//    npwd='mysqlzjseek123456789';
//    nport=3306;
//    nuser='root';
//    //nhost='121.40.149.142';
//    //npwd='x2mvzZ0f23';
//    //nport=14712;
//    //nhost='115.238.54.182';
//    //npwd='x2mvzZ0f23.s';
//    //nport=3306;
//} else
//{
//    nhost='11.1.2.7';
//    npwd='x2mvzZ0f23.s';
//    nuser='jqinspg';
//    nport=3306;
//}


module.exports = mysql.createPool({
    connectionLimit : 5,
    host: ev[ev.ftype].nhost,
    user: ev[ev.ftype].nuser,
    password: ev[ev.ftype].npwd,
    database:'jqins',
    port: ev[ev.ftype].nport,
    charset:'utf8mb4',
    stringifyObjects:true
});